package com.cwt_taxi_xa.db.bll;

import android.content.Context;

import com.cwt_taxi_xa.db.dal.QuestionDao;
import com.cwt_taxi_xa.model.QuestionInfo;

import java.util.ArrayList;

public class QuestionBiz {

	private QuestionDao dao;
//	private Context context;

	public QuestionBiz(Context context) {
//		this.context = context;
		dao = new QuestionDao(context);
	}

	public int updateReadStatus(int id){
		return dao.updateReadStatus(id);
	}

	public int updateDownStatus(QuestionInfo info){
		return dao.updateDownStatus(info);
	}

	/**
	 * 获取总条数
	 * @author ferch
	 * @return
	 */
	public int getCount() {
		return dao.getCount();
	}

	public ArrayList<QuestionInfo> getQuestions(int currentPage, int pageCount){
		return dao.getQuestions(currentPage, pageCount);
	}

	/**批量添加*/
	public int addQuestions(ArrayList<QuestionInfo> infos){
		return dao.save(infos);
	}

	/**单个添加*/
	public int addQuestion(QuestionInfo info){
		return dao.save(info);
	}

	/**批量修改*/
	/*public int updateQuestions(ArrayList<QuestionInfo> infos){
		return dao.update(infos);
	}*/

	/**先清空后批量添加*//*
	public int refreshQuestions(ArrayList<QuestionInfo> infos){
		return dao.refresh(infos);
	}

	*//**
	 * 删除事件
	 * @return
	 *//*
	public int delete(ArrayList<QuestionInfo> infos){
		return dao.delete(infos);
	}*/

	/**清空*/
	public int clearQuestions(){
		return dao.clear();
	}
}
